#include "obstacle.h"
#include <QPainter>
#include <QStyleOption>


Obstacle::Obstacle(QPoint p, float r):MapElement()
{
    m_r=r/2;
    m_p=QPoint(p.x()+m_r,p.y()+m_r);
    //setBoundingRect(QRectF(m_p.x(),m_p.y(),m_r+15,m_r+15));
}


void Obstacle::paint(QPainter *painter, const QStyleOptionGraphicsItem* , QWidget* )
{

    painter->setBrush(Qt::gray);
    painter->drawEllipse(m_p.x()-m_r,m_p.y()-m_r,2*m_r,2*m_r);


}

float Obstacle::getR()
{
    return m_r;
}


QPoint Obstacle::getS()
{
    return m_p;
}
